﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BonjourHotel.Core.Localization;
using System.Web.UI;

namespace BonjourHotel.Core.Menu
{
    public class BaseBHMenu : UserControl
    {
        public MenuMode Mode
        {
            get
            {
                if (ViewState["_menuMode"] == null)
                    return MenuMode.Normal;
                else
                    return (MenuMode)Enum.Parse(typeof(MenuMode), ViewState["_menuMode"].ToString());
            }
            set
            {
                ViewState["_menuMode"] = value;
            }
        }

        protected string UpdateText;
        protected string RemoveText;
        protected string CreateText;
        protected string SortText;
        protected string FindText;

        protected void GetLocalization(string menuName)
        {
            UpdateText = LocaleManager.GetLocaleString("menu." + menuName.ToLower() + ".update");
            RemoveText = LocaleManager.GetLocaleString("menu." + menuName.ToLower() + ".remove");
            CreateText = LocaleManager.GetLocaleString("menu." + menuName.ToLower() + ".create");
            SortText = LocaleManager.GetLocaleString("menu." + menuName.ToLower() + ".sort");
            FindText = LocaleManager.GetLocaleString("menu." + menuName.ToLower() + ".find");
        }
    }
}
